package com.shengchao.examstar.rpc.question.enums;

import lombok.Getter;

public enum QuestionSetTypeEnum {
    //    LY_TRUE_QUESTION(1, "历年真题"),
//    SIMULATION_EXERCISE(2, "模拟练习"),
    KNOWLEDGE_POINT_EXERCISE(3, "知识点练习"),
    //    HOMEWORK(4, "作业"),
    WRONG_QUESTION(5, "错题")
    //ai知识点专项练习
    ,AI_KNOWLEDGE_POINT_EXERCISE(6, "ai知识点专项练习")
    ;
    @Getter
    private final Integer code;
    @Getter
    private final String name;

    QuestionSetTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    //根据code获取枚举
    public static QuestionSetTypeEnum getEnumByCode(Integer code) {
        for (QuestionSetTypeEnum value : QuestionSetTypeEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
